package com.gin.kotlin.no_gay_alliance.adapter.item

import android.content.Context
import android.view.View
import androidx.viewbinding.ViewBinding
import com.gin.kotlin.no_gay_alliance.base.AbstractBindingRecyclerViewAdapter
import com.gin.kotlin.no_gay_alliance.base.MyHandler
import com.gin.nga.response.item.ItemInfo

abstract class AbstractItemAdapter<T : ViewBinding>(context: Context, handler: MyHandler, zebraStripe: Boolean = true, val listener: View.OnClickListener) :
    AbstractBindingRecyclerViewAdapter<T, ItemInfo>(context, handler, zebraStripe, mutableListOf()){
    override fun onBindViewHolder(holder: ViewHolder<T>, position: Int, b: T, dataModel: ItemInfo) {
        // 根节点设置点击事件
        b.root.tag = dataModel
        b.root.setOnClickListener(listener)
    }
}